#分割线
print('='*100)
#正序输出
for i in range(1,10):
    for j in range(1,i+1):
        print('{0}X{1}={2:<2d}  '.format(j,i,j*i),end='')
    print()
#分割线
print('='*100)
#倒序输出
for i in range(9,0,-1):
    for j in range(1,i+1):
        print('{0}X{1}={2:<2d}  '.format(j,i,j*i),end='')
    print()
#分割线
print('='*100)